<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>全局混合</title>
  <script src="vue.js"></script>
</head>
<body>
<script>
  // 为自定义的选项 'myOption' 注入一个处理器。 
  Vue.mixin({
    created: function () {
      var myOption = this.$options.myOption
      if (myOption) {
        console.log(myOption)
      }
    }
  })
  new Vue({
    myOption: 'happy'
  })
  // -> "happy"
</script>
</body>
</html>